Imports Castle.ActiveRecord

''' <summary>
'''	Gerado por MyGeneration usando o template ActiveRecord Object Mapper-1.0.3
'''	Criado em 14/08/2010 00:29:39
''' </summary>
''' <remarks></remarks>

<Serializable(), ActiveRecord("permissao", DynamicUpdate:= true)> _
Public Class Permissao
	Inherits ActiveRecordBase(Of Permissao)
	
	Private _cd_permissao As Integer
	Private _Modulo As Modulo
	Private _permissao_descricao As String


    Private _Perfils As IList = New ArrayList

	<PrimaryKey(PrimaryKeyType.Sequence, SequenceName:="permissao_cd_permissao_seq")> _
	Public Property cd_permissao() As Integer
		Get
			Return _cd_permissao
		End Get
		Set(ByVal value As Integer)
			_cd_permissao = value
		End Set
	End Property

	<BelongsTo("cd_modulo")> _
	Public Property Modulo() As Modulo
		Get
			Return _Modulo
		End Get
		Set(ByVal value As Modulo)
			_Modulo = value
		End Set
	End Property

	<[Property]("permissao_descricao")> _
	Public Property permissao_descricao() As String
		Get
			Return _permissao_descricao
		End Get
		Set(ByVal value As String)
			_permissao_descricao = value
		End Set
	End Property

    <HasAndBelongsToMany(GetType(Perfil), Table:="perfilpermissao", ColumnKey:="cd_permissao", ColumnRef:="cd_perfil", Inverse:=True, Lazy:=True)> _
    Public Property Perfilpermissao() As IList
        Get
            Return _Perfils
        End Get
        Set(ByVal value As IList)
            _Perfils = value
        End Set
    End Property
End Class
